package com.zjd.controller.servlet;

import com.zjd.domain.Category;
import com.zjd.service.CategoryService;
import com.zjd.service.impl.CategoryServiceImpl;
import com.zjd.utils.BaseServlet;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

@WebServlet(urlPatterns = "/CategoryServlet")
public class CategoryServlet extends BaseServlet {
    private CategoryService service = new CategoryServiceImpl();

    public void selectCategorys() throws ServletException, IOException {
        List<Category> categories = service.selectCategorys();
        writeJson(response,categories);
    }

}